<?php include('includes/start_session.php') ?>
<?php include('includes/login_required.php') ?>
<?php
	include('includes/agenda_validation.php');
			
		$valid = validation($message);
		if($valid == true)
		{
			$error = '';
			$error2 = '';
			if(isset($_GET['action']) && $_GET['action'] == 'add')
				data_validation($error, $error2);
		}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
	<title>e-class add agenda</title>
	
	<link href="styles/site.css" rel="stylesheet" type="text/css" />
    <link href="styles/zipped.css" rel="stylesheet" type="text/css" />

    <script src="scripts/scripts.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="scripts/datetimepicker.js">

	//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
	//Script featured on JavaScript Kit (http://www.javascriptkit.com)
	//For this script, visit http://www.javascriptkit.com
	</script>
</head>
<body onload="same_height()">
	<?php include('includes/header.php') ?>
	<div id="content" class="content_padding">
		<?php
			if($valid == true)
			{
				echo $message;
		?>
		<form action='<?php echo 'add_agenda.php?id=' . $_GET['id'] . '&action=add' ?>' method="post">
			<table class="big_height_stretched_table">
				<?php
					if($error != '')
					{
                    	echo '<tr><td colspan="2"><span class="error">' . $error . '</span></td></tr>'; 
					}
				?>
				<tr>
					<td>
							<p><i>(πατήστε στην εικόνα)</i><br />Ημερομηνία έναρξης:</p>
                         	<input readonly="readonly" id="start_date" name="start_date" type="text" size="25" />
							<a href="javascript:NewCal('start_date','ddmmyyyy', true, 24)">
							<img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a date" /></a>
					</td>
					<td>
							<p><i>(πατήστε στην εικόνα)</i><br />Ημερομηνία λήξης:</p>
                         	<input readonly="readonly" id="end_date" name="end_date" type="text" size="25" />
							<a href="javascript:NewCal('end_date','ddmmyyyy', true, 24)">
							<img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a date" /></a>
					</td>
				</tr>
				<?php
					if($error2 != '')
                    	echo '<tr><td colspan="2"><span class="error">' . $error2 . '</span></td></tr>';
                ?>
                <tr>
                	<td colspan="1">
                		<span>Τίτλος:</span>
                	</td>
                </tr>
                <tr>
                	<td colspan="1">
                		<input type="text" name="title" class="title_input" />
                	</td>
                </tr>
                <tr>
               		<td colspan="6">
                    	<p class="textarea_p">Λεπτομέρειες:</p>
                        <textarea name="description" cols="50" rows="8"></textarea>
                	</td>
                </tr>
				<tr>
                    <td colspan="5">
                    	<?php
                    		echo '<a class="course_anchor" href="agenda.php?id=' . $_GET['id'] . '">Επιστροφή</a>';
                    	?>
                    </td>
                    <td class="right_align">
                    	<input type="submit" value="Προσθήκη" />
                    </td>
           		</tr>
			</table>
		</form>
		<?php }
			  else
			  	echo $message;
		?>
	</div>
	<?php include('includes/footer.php') ?>
</body>
</html>
